package server.service.nurse;

import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

import domain.nurse.Nurse;
import domain.session.Response;

public class NurseAction {
	
	private NurseModel nurseModel;
	
	public NurseAction() {
		nurseModel = new NurseModel();
	}
	
	public Response getAllNurses(final JSONObject requestJson) {
		List<Nurse> nurses = nurseModel.getAllNurses();
		JSONArray nursesArray = new JSONArray();
		for (Nurse nurse : nurses) {
			nursesArray.put(nurse.getJSON());
		}
		JSONObject responseJson = new JSONObject();
		responseJson.put("nurses", nursesArray);
		Response response = new Response(true, responseJson);
		return response;
	}

}
